package interaction.input.concrete;

import interaction.game.GameObjectCollection;
import interaction.game.GameObjectFactory;
import interaction.game.Hero;
import interaction.game.ScoreItem;
import processing.core.PApplet;
import processing.core.PGraphics;
import processing.core.PVector;

public abstract class AbstractGameComponent<T> extends AbstractBeatComponent<T> {
	private GameObjectCollection objects;
	private GameObjectFactory factory;
	private Hero panda;
	
	public AbstractGameComponent(PVector position, PVector size, PApplet a) {
		super(position, size);
		factory = new GameObjectFactory(a);
	}
	
	public void init()
	{
		objects = new GameObjectCollection();
		panda = factory.createHero();
	}
	
	public Hero getPanda()
	{
		return panda;
	}
	
	public GameObjectFactory getFactory() {
		return factory;
	}
	
	public GameObjectCollection getObjects() {
		return objects;
	}
	
	protected void drawRelative(PGraphics g) {
		getObjects().update();
		getObjects().draw(g);
	}
}
